package com.example.minisqlite;

import java.sql.SQLException;
import java.util.List;

public class UpdateStatement implements Statement {

    private final String tableName;
    private final List<String> columns;
    private final List<Object> values;
    private final Engine.Filter filter;

    public UpdateStatement(String tableName, List<String> columns, List<Object> values, Engine.Filter filter) {
        this.tableName = tableName;
        this.columns = columns;
        this.values = values;
        this.filter = filter;
    }

    @Override
    public ResultSet execute(Engine engine) throws SQLException {
        return engine.update(tableName, columns, values, filter);
    }
}
